import { postRequest, uploadRequest } from '../request'

const user = {
  /** 注册/登陆(app端使用手机验证码) */
  mobileLogin: params => postRequest('/api/user.user/mobilelogin', params),
  /** 登陆(app端使用密码) */
  pwdLogin: params => postRequest('/api/user.user/pwdlogin', params),
  /** 修改/设置密码 */
  resetLoginPwd: params => postRequest('/api/user/resetpwd', params),
  /** 找回密码 */
  findPwd: params => postRequest('/api/user/findpwd', params),
  /** 获取地址列表 */
  getAddressList: params => postRequest('/api/user/address_list', params),
  /** 添加/编辑收货地址 */
  setAddress: params => postRequest('/api/user/address', params),
  /** 删除收货地址 */
  deleteAddress: params => postRequest('/api/user/address_del', params),
  /** 修改个人设置 */
  editUserProfile: params => postRequest('/api/user/profile', params),
  /** 获取分期账单 */
  getStagesBill: params => postRequest('/api/user/get_stages', params),
  /** 获取银行列表 */
  getBankList: () => postRequest('/api/Bankcard/banklist'),
  /** 获取用户绑定的银行卡 */
  getUserBankCard: params => postRequest('/api/Bankcard/getbanklist', params),
  /** 获取紧急联系人关系列表 */
  getRelation: () => postRequest('/api/Risk/getrelation'),
  /** 会员基本信息获取 （会员授权状态查询） */
  getUserBasicInfo: () => postRequest('/api/Risk/getuserinfo'),
  /** 会员基本信息修改 */
  updateUserBasicInfo: params => postRequest('/api/Risk/updateuserinfo', params),
  /** 保存用户通讯录 */
  saveUserAddressBook: params => postRequest('/api/Risk/riskaddressbook', params),
  /** 上传身份证 */
  uploadIdentity: params => uploadRequest('/api/risk/identity', params),
}

export default user